#pragma once

#include <vector>
#include <QByteArray>
#include "BotBasic.h"


typedef struct _STRIKES_ENTRY
{
    unsigned int        Head;
    unsigned int        Chest;
    unsigned int        Groin;
    unsigned int        Legs;
} STRIKES_ENTRY, * PSTRIKES_ENTRY;

class CBotCombats : public CBotBasic
{
public:
    CBotCombats();
    ~CBotCombats();

public:
    void Reload(std::string &Login, std::string &Password, bool AvalonCity = false);
    void SetLookCharName(std::string &Name);

private:
    std::string         m_Login;
    std::string         m_Password;
    std::string         m_CharName;
    bool                m_AvalonCity;

private:
    bool IsIndexPage(std::string &Html);
    bool DoLogin();
    bool GetAction(std::string &Url, std::string &Result);
    bool PostAction(std::string &Url, std::string &PostFields, std::string &Result);
    bool GetCombatList(std::string &CurrentDate, std::string &PrevDate, std::vector<std::string> &LogId);
    bool AddStrikeCount(std::string &LogId, STRIKES_ENTRY &Strikes);

public:
    bool GetTotalStrikesCount(unsigned int StrikesCount, STRIKES_ENTRY &Strikes);
    bool GetCharImage(QByteArray &Img);
    void GetPercentageStrikeStat(STRIKES_ENTRY &Strikes, STRIKES_ENTRY &PercentStrikes);
};